package com.wuliu.controller;

import com.wuliu.common.annotation.RepeatSubmit;
import com.wuliu.common.core.domain.AjaxResult;
import com.wuliu.common.core.domain.ApiResult;
import com.wuliu.system.domain.TspProblem;
import com.wuliu.system.domain.dto.app.TspProblemDto;
import com.wuliu.system.service.ITspProblemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author realue
 * @version 1.0
 * @date 2023-11-23 17:14
 */
@Api(tags = {"问题件控制器"})
@RestController
@RequestMapping("/app/problem")
public class TspProblemController {
    @Resource
    private ITspProblemService tspProblemService;

    @RepeatSubmit
    @ApiOperation(value = "批量新增问题件")
    @PostMapping("/add")
    public ApiResult<Boolean> add(@RequestBody @Validated List<TspProblemDto> dto) {
        return ApiResult.success(tspProblemService.add(dto));
    }
}
